<template>
  <div class="plane">
    <h4>姓名:{{myname}}--年龄:{{myage}}</h4>
    <h4>产地：{{address}}</h4>
  </div>
</template>
<script>
export default {
   inject: ['name', 'age'],
  data() {
    return {
      address: '',
      myname:this.name,
      myage:this.age
    }
  },
  methods:{
   
  },
  mounted() {
    //监听getAddress事件
    this.$bus.$on('getAddress', (e) => {
      this.address = e
    })
  },
}
</script>
<style scoped lang='scss'>
.plane{
  border: 1px solid blanchedalmond;
}
</style>